def divisors(x):
	i = 1
	result = []
	while i <= x:
		if x % i == 0:
			result.append(i)
		i += 1
	return result

def isPerfect(x):
	return sum(divisors(x)[:-1]) == x

def isDeficient(x):
	return sum(divisors(x)[:-1]) < x

def isAbundant(x):
	return sum(divisors(x)[:-1]) > x

def factorial(x):
	if x < 1:
		return 0
	
	factorial = 1
	for i in range(1, x + 1):
		factorial *= i
		
	return factorial

def sum(l):
	sum = 0
	
	for i in l:
		sum += i
		
	return sum